One of the challenges of concurrent systems involves finding and fixing concurrency errors. Data races are an important class of concurrency errors, where a software application fails to use proper synchronization when accessing data shared with another application or with other parts of the same application. A program contains a data race if two conflicting accesses to a memory location can occur concurrently. Two memory accesses in a program are said to conflict if they access the same memory location and at least one of them is a write.
For example, two different threads of a program may reference bit fields that map to the same memory location. Concurrent access by both threads to the memory location may cause a data race. As a result of the data race, an update by one thread may hide an update made by the other.
The possible effects of data race conditions include immediate program crashes, silent lost updates, and data corruptions. All of these effects are challenging to reproduce and debug.